/**
 * 找第二大的数的位置 
 */
#include <bits/stdc++.h>
#include <bits/extc++.h>
using namespace std;

using llt = long long;
using vi = vector<int>;
using vll = vector<llt>;
using pii = pair<int, int>;
using pll = pair<llt, llt>;
using Real = long double;

int N;
vector<pii> A;


void work(){ 
    cin >> N;
    A.assign(N, {});
    for(int i=0;i<N;++i){
        cin >> A[i].first;
        A[i].second = i + 1;
    }
    sort(A.begin(), A.end());
    cout << A[N - 2].second << endl;
	return;
}

int main(){
#ifndef ONLINE_JUDGE
    freopen("z.txt", "r", stdin);
#endif
    ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);	
    int nofkase = 1;
	// cin >> nofkase;
	while(nofkase--) work();
	return 0;
}